include ../../Makefile.env

# == make ===========================================
make: check deploy

# == deploy  ========================================
deploy: "$(DEPLOYDIR)$(BINDIR)" "$(DEPLOYDIR)$(LIBDIR)"
	mkdir -p $(DEPLOYDIR)$(BINDIR)template/
	ln -sf $(STAFF_HOME)/bin/template/common $(DEPLOYDIR)$(BINDIR)template/
	ln -sf $(STAFF_HOME)/lib/codegen $(DEPLOYDIR)$(LIBDIR)
	cp -f --parents $$(find template -type f | grep -v '.svn') $(DEPLOYDIR)$(BINDIR)

# == distrib =========================================
distrib:;

# == install ========================================
install: check "$(INSTALLDIR)$(BINDIR)" "$(INSTALLDIR)"
	cp --parents $$(find template -type f | grep -v '.svn') $(INSTALLDIR)$(BINDIR)

# == uninstall ======================================
uninstall: check
	xargs rm -Rf $(INSTALLDIR)$(BINDIR)template/mq*

# == clean ==========================================
clean:

# == mkdir ==========================================
"%/":
	@[ -z "$@" -o -d "$@" ] || mkdir -p $@ && chmod g+w $@
